package cn.tedu.rabbitmqspringboot.m1;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {

    @Autowired
    private AmqpTemplate amqpTemplate;
    /*
    自己定义的send()方法，需要自己手动区调用
     */
    public void send(){
        amqpTemplate.convertAndSend("helloworld","helloworld!");
    }
}
